package chapter1109;

import java.util.Calendar;
import java.util.concurrent.TimeUnit;

public class Timer {
    public static void main(String[] args) {
        Calendar calendar = Calendar.getInstance();
        int hour = calendar.get(Calendar.HOUR_OF_DAY);
        int minute = calendar.get(Calendar.MINUTE);
        int second = calendar.get(Calendar.SECOND);

        System.out.println("StartTime:"+hour + ":" + minute + ":" + second);

        calendar.add(Calendar.HOUR_OF_DAY, 1);

        int newHour = calendar.get(Calendar.HOUR_OF_DAY);

        System.out.println("OverTime: " +newHour + ":" + minute + ":" + second);
    }
//    public Timer(int remainSecond) throws InterruptedException {
//        System.out.println("Count from "+remainSecond);
//        while(remainSecond > 0){
//            System.out.println("remians "+ --remainSecond +" s");
//            TimeUnit.SECONDS.sleep(1);
//        }
//        System.out.println("Time is out");
//    }
//
//	public static void main(String[] args) throws InterruptedException {
//        System.out.println("Test start");
//        new Timer(60*60);
//        System.out.println("Test end");
//	}
}
